package com.nwpusp.display.views.components;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.View;

import com.example.petssports.R;
import com.nwpusp.display.GlobalVar;

public class HurdleRight extends View{
	public Bitmap bgBitmap;
	public float x;
	public float y;
	public float newHeight;
	public float width;
	public float height;
	
	public HurdleRight(Context view,float newHeight){
		super(view);
		this.newHeight = newHeight;
		newHeight = newHeight*(float)1.2;
		getBitmapSource();
		bgBitmap = reBitmap(bgBitmap);
	}
	
	private Bitmap reBitmap(Bitmap bitmap){
		bitmap = GlobalVar.VerticalScaleFixHeight(bitmap,newHeight);
		width = bitmap.getWidth();
		height = bitmap.getHeight();
		GlobalVar.HurdleDiff = width/2;
		return bitmap;
	}
	
	public void setLocation(float x ,float y){
		this.x = x - GlobalVar.HurdleDiff;
		this.y = y;
	}
	
	private void getBitmapSource(){
		bgBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.lan_right);
	}
	public Bitmap draw(){
		return bgBitmap;
	}
}